$(function () {
    $(".hascontent").hover(
                function () {
                    var $this = $(this);
                    if ($this.next().html().length > 10) {
                        var left = $this.offset().left;
                        if ((left + 150) > $(window).width()) {
                            left = left + $this.outerWidth() - 150;
                        }
                        var top = $this.offset().top + 20+$this.height();
                        if ((top + 120) > $(window).height()) {
                            top = top + $this.outerHeight() - 190 - $this.height();
                        }
                        if ($.browser.msie) {
                            $("#tips").css({ "left": left, "top": top, "display": "block" }).html($this.next("span").children().html());
                        } else {
                            $("#tips").css({ "left": left, "top": top }).html($this.next("span").children().html()).show();
                        }
                    } else {
                        $.AjaxETM("GetCourseTips", { "Guid": $(this).attr("course") }, function (result) {
                            if (result != null) {
                                $this.next().html(result);
                                var left = $this.offset().left;
                                if ((left + 150) > $(window).width()) {
                                    left = left + $this.outerWidth() - 150;
                                }
                                var top = $this.offset().top + 20+$this.height();
                                if ((top + 120) > $(window).height()) {
                                    top = top + $this.outerHeight() - 190 - $this.height();
                                }
                                if ($.browser.msie) {
                                    $("#tips").css({ "left": left, "top": top, "display": "block" }).html($this.next("span").children().html());
                                } else {
                                    $("#tips").css({ "left": left, "top": top }).html($this.next("span").children().html()).show();
                                }
                            }
                        }, false, "text");
                    }
                },
                function () {
                    if ($.browser.msie) {
                        $("#tips").css("display", "none");
                    } else {
                        $("#tips").hide();
                    }
                }
            );
            });